package com.mzy.olddate.demo.init;//: initialization/ArraysOfPrimitives.java

/**
 * 这里有一个比较重要的结论，f成员变量。 数组有一个特别的成员变量.length（） -- 指令去完成获取长度的
 */
public class ArraysOfPrimitives {
  public static void main(String[] args) {
    int[] a1 = { 1, 2, 3, 4, 5 };
    int[] a2;
    System.out.println(a1.length);
    String[] a3 = {"1","2"};
    System.out.println(a3.length);
    a2 = a1;
    for(int i = 0; i < a2.length; i++)
      a2[i] = a2[i] + 1;
    for(int i = 0; i < a1.length; i++)
      System.out.println("a1[" + i + "] = " + a1[i]);
  }
} /* Output:
a1[0] = 2
a1[1] = 3
a1[2] = 4
a1[3] = 5
a1[4] = 6
*///:~
